# class Solution:
#     def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
#         return set(nums1).intersection(set(nums2))

class Solution:
    def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
        mapper1={}
        mapper2={}
        result=[]
        for i in nums1:
            mapper1[i]=i
        for j in nums2:
            mapper2[j]=j
        for k in mapper2.keys():
            try:
                result.append(mapper1[k])
            except KeyError:
                pass
        return result

'''
执行用时：
48 ms
, 在所有 Python3 提交中击败了
98.33%
的用户
内存消耗：
13.6 MB
, 在所有 Python3 提交中击败了
9.88%
的用户
'''